﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AnlianCommon.Common.Migrations
{
    public partial class log1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AccountingUnits",
                columns: table => new
                {
                    AccountingUnitId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AccountingUnitName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AccountingUnits", x => x.AccountingUnitId);
                });

            migrationBuilder.CreateTable(
                name: "Bankaccounts",
                columns: table => new
                {
                    BankaccountId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BankaccountName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Bank = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BaccountPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Bphone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Battribute = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Brelationship = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Bremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Bankaccounts", x => x.BankaccountId);
                });

            migrationBuilder.CreateTable(
                name: "BasicInfos",
                columns: table => new
                {
                    BasicId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BasicName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicFormer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Card = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicSex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Basicbirth = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProvinceIdjiGuan = table.Column<int>(type: "int", nullable: true),
                    Politic = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NationId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Household = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: true),
                    BasicAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicPartici = table.Column<DateTime>(type: "datetime2", nullable: true),
                    BasicPhysical = table.Column<DateTime>(type: "datetime2", nullable: true),
                    BasicGraduate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Education = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicGradate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    BasicChannel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Marriage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicWedd = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ForeignId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Basictech = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Basicstature = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicsWigth = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicBlood = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicPhys = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Basicforeign = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BasicLanguage = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BasicInfos", x => x.BasicId);
                });

            migrationBuilder.CreateTable(
                name: "BreedingHistorys",
                columns: table => new
                {
                    BreedingHistoryId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BreedingEarBugle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DateBreeding = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SeedMaleEarBugle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PregnancyTestDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ParturitionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    HealthyLambNums = table.Column<int>(type: "int", nullable: true),
                    HealthyLambWeight = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WeakLambsNums = table.Column<int>(type: "int", nullable: true),
                    DeformityNums = table.Column<int>(type: "int", nullable: true),
                    StillbirthNums = table.Column<int>(type: "int", nullable: true),
                    MummificationNums = table.Column<int>(type: "int", nullable: true),
                    TeratogenesiNums = table.Column<int>(type: "int", nullable: true),
                    CurrentParity = table.Column<int>(type: "int", nullable: true),
                    WeanedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    WeanedNums = table.Column<int>(type: "int", nullable: true),
                    WeanedLitterWeight = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BreedingHistorys", x => x.BreedingHistoryId);
                });

            migrationBuilder.CreateTable(
                name: "Breedingmothers",
                columns: table => new
                {
                    BreedingmotherId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Breed = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Reproductivestate = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sheepmonthsold = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    Field = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Breedingmothers", x => x.BreedingmotherId);
                });

            migrationBuilder.CreateTable(
                name: "Breedingsettings",
                columns: table => new
                {
                    BreedingsettingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StudRAMS = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Breedingpattern = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Estrusspecies = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    Field = table.Column<int>(type: "int", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Breedingsettings", x => x.BreedingsettingId);
                });

            migrationBuilder.CreateTable(
                name: "ChildbirthTips",
                columns: table => new
                {
                    ChildbirthTipsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GestationDay = table.Column<int>(type: "int", nullable: true),
                    House = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Field = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MatingDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PreparationType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ChildbirthTips", x => x.ChildbirthTipsId);
                });

            migrationBuilder.CreateTable(
                name: "Clients",
                columns: table => new
                {
                    ClientId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ClientTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResponsiblePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ResponsibleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CVindustry = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CVCreditcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CVmnemonic = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientarchives = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientstage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientlabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientproducts = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientcooperate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CVAffiliation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CVstatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SuperiorClient = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientlevel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Clientremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesmanName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Clients", x => x.ClientId);
                });

            migrationBuilder.CreateTable(
                name: "Cottages",
                columns: table => new
                {
                    CottageId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CottageTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersId = table.Column<int>(type: "int", nullable: true),
                    Production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Status = table.Column<bool>(type: "bit", nullable: true),
                    Ramark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FlatId = table.Column<int>(type: "int", nullable: true),
                    FarmId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Cottages", x => x.CottageId);
                });

            migrationBuilder.CreateTable(
                name: "CottageTypes",
                columns: table => new
                {
                    CottageTypeId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CottageTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CottageTypes", x => x.CottageTypeId);
                });

            migrationBuilder.CreateTable(
                name: "Countys",
                columns: table => new
                {
                    CountyId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CountyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DirectlyId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Countys", x => x.CountyId);
                });

            migrationBuilder.CreateTable(
                name: "Crossbreedings",
                columns: table => new
                {
                    CrossbreedingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    BredSheepNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AgeTransfer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Crossbreedings", x => x.CrossbreedingId);
                });

            migrationBuilder.CreateTable(
                name: "Departments",
                columns: table => new
                {
                    DepartmentId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentSuperior = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentDeactivatebool = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentTypeId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentOrdinal = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProvinceId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DirectSuperior = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentSupervisor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InChargeHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Treasurer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ViewablePersonnel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FunctionalSystemId = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Departments", x => x.DepartmentId);
                });

            migrationBuilder.CreateTable(
                name: "DepartmentTypes",
                columns: table => new
                {
                    DepartmentTypeId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DepartmentTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pid = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DepartmentTypes", x => x.DepartmentTypeId);
                });

            migrationBuilder.CreateTable(
                name: "Directlys",
                columns: table => new
                {
                    DirectlyId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DirectlyName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Directlys", x => x.DirectlyId);
                });

            migrationBuilder.CreateTable(
                name: "EwesGiveBirths",
                columns: table => new
                {
                    EwesGiveBirthId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    EarBugles = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PregnancyDays = table.Column<int>(type: "int", nullable: true),
                    ParturitionDifficulty = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FatSheepBatch = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MaternalInstinct = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Lactation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Mastitis = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NestNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    HealthyLambNums = table.Column<int>(type: "int", nullable: true),
                    WeakLambsNums = table.Column<int>(type: "int", nullable: true),
                    DeformityNums = table.Column<int>(type: "int", nullable: true),
                    StillbirthNums = table.Column<int>(type: "int", nullable: true),
                    MummificationNums = table.Column<int>(type: "int", nullable: true),
                    TeratogenesiNums = table.Column<int>(type: "int", nullable: true),
                    LivingLambs = table.Column<int>(type: "int", nullable: true),
                    LitterWeight = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EwesGiveBirths", x => x.EwesGiveBirthId);
                });

            migrationBuilder.CreateTable(
                name: "Fields",
                columns: table => new
                {
                    FieldId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FieldName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Prefix = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StartNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FieldSum = table.Column<int>(type: "int", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Fields", x => x.FieldId);
                });

            migrationBuilder.CreateTable(
                name: "FirstLevels",
                columns: table => new
                {
                    FirstLevelId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FirstLevelName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FirstLevels", x => x.FirstLevelId);
                });

            migrationBuilder.CreateTable(
                name: "FirstPregnancyTestPrompts",
                columns: table => new
                {
                    FirstPregnancyTestPromptId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GestationDay = table.Column<int>(type: "int", nullable: true),
                    House = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Field = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PreparationType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FirstPregnancyTestPrompts", x => x.FirstPregnancyTestPromptId);
                });

            migrationBuilder.CreateTable(
                name: "Flats",
                columns: table => new
                {
                    FlatId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CompanieFullName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompanieLOGO = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SecondLevelId = table.Column<int>(type: "int", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: true),
                    FullAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompaniePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreditCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CompanieDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeactivateCompanie = table.Column<bool>(type: "bit", nullable: true),
                    Head = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InChargeHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ViewablePersonnel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AccountingUnitId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Flats", x => x.FlatId);
                });

            migrationBuilder.CreateTable(
                name: "FunctionalSystems",
                columns: table => new
                {
                    FunctionalSystemId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FunctionalSystemName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FunctionalSystems", x => x.FunctionalSystemId);
                });

            migrationBuilder.CreateTable(
                name: "GPprices",
                columns: table => new
                {
                    GPpriceId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodsName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Gguige = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GSmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GEmoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GZhek = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Gsummoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    GDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    GschemeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GUpdatetime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Gdanwei = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GPprices", x => x.GPpriceId);
                });

            migrationBuilder.CreateTable(
                name: "LambWeanings",
                columns: table => new
                {
                    LambWeaningId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LambEarBugle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    WeanedWeight = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_LambWeanings", x => x.LambWeaningId);
                });

            migrationBuilder.CreateTable(
                name: "MeasurementBodies",
                columns: table => new
                {
                    MeasurementBodyId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    MeasurementHouse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MeasurementField = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Measurementdate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Measurementday = table.Column<int>(type: "int", nullable: true),
                    SheepHeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepLength = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepChest = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepPipe = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepScrotum = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepBackfat = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    EyemuscleArea = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    EyemuscleWidth = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MeasurementBodies", x => x.MeasurementBodyId);
                });

            migrationBuilder.CreateTable(
                name: "Permissions",
                columns: table => new
                {
                    PermissionId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PermissionName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Permissions", x => x.PermissionId);
                });

            migrationBuilder.CreateTable(
                name: "Personnels",
                columns: table => new
                {
                    PersId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PersName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersSex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersCardType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PersCollege = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Education = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EnterpriseId = table.Column<int>(type: "int", nullable: true),
                    StaffState = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    PersEntry = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PersRegular = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PersFunction = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PresTrain = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PresLevel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PresAccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PresPass = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Personnels", x => x.PersId);
                });

            migrationBuilder.CreateTable(
                name: "PhaseDeterminations",
                columns: table => new
                {
                    PhaseDeterminationId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    CurrentHouse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentField = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    CurrentDay = table.Column<int>(type: "int", nullable: true),
                    OcclusionTeeth = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepHair = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSpot = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Hoofolor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MouthColor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepAngle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DistributionFat = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PhaseDeterminations", x => x.PhaseDeterminationId);
                });

            migrationBuilder.CreateTable(
                name: "PregnancyTests",
                columns: table => new
                {
                    PregnancyTestId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PregnancyTestDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    EarBugles = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PregnancyTestResults = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PregnancyTestWays = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    NumberParities = table.Column<int>(type: "int", nullable: true),
                    PregnancyDays = table.Column<int>(type: "int", nullable: true),
                    CurrentBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CurrentColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Responsible = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DocumentNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PregnancyTests", x => x.PregnancyTestId);
                });

            migrationBuilder.CreateTable(
                name: "Provinces",
                columns: table => new
                {
                    ProvinceId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProvinceName = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Provinces", x => x.ProvinceId);
                });

            migrationBuilder.CreateTable(
                name: "Records",
                columns: table => new
                {
                    RecordId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RecordAuricle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordCorpuscle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordMother = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordFather = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordBreed = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordBorn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    RecordSite = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordWeight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    RecordRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecordType = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Records", x => x.RecordId);
                });

            migrationBuilder.CreateTable(
                name: "RolePerms",
                columns: table => new
                {
                    RolePermId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RolePermName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleId = table.Column<int>(type: "int", nullable: true),
                    PermissionId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RolePerms", x => x.RolePermId);
                });

            migrationBuilder.CreateTable(
                name: "Roles",
                columns: table => new
                {
                    RoleId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RoleName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RoleDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Roles", x => x.RoleId);
                });

            migrationBuilder.CreateTable(
                name: "SecondLevels",
                columns: table => new
                {
                    SecondLevelId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SecondLevelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FirstLevelId = table.Column<int>(type: "int", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SecondLevels", x => x.SecondLevelId);
                });

            migrationBuilder.CreateTable(
                name: "Seedweanings",
                columns: table => new
                {
                    SeedweaningId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Weaningdate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Auricle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Breastfeedingdays = table.Column<int>(type: "int", nullable: true),
                    Seedweight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Weaningnumber = table.Column<int>(type: "int", nullable: true),
                    Totallitter = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    Field = table.Column<int>(type: "int", nullable: true),
                    Transferbuilding = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Drivefield = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Document = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Weaningreason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Seedweanings", x => x.SeedweaningId);
                });

            migrationBuilder.CreateTable(
                name: "SheepCullings",
                columns: table => new
                {
                    SheepCullingId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    EliminationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EliminationReasons = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: true),
                    TreatmentMeasures = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    ReproductiveState = table.Column<int>(type: "int", nullable: true),
                    EliminationMonth = table.Column<int>(type: "int", nullable: true),
                    EliminationDay = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EliminationHouse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    EliminationField = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepCullings", x => x.SheepCullingId);
                });

            migrationBuilder.CreateTable(
                name: "SheepDices",
                columns: table => new
                {
                    SheepDieId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DieDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DieReason = table.Column<int>(type: "int", nullable: true),
                    SheepBreed = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    ReproductiveState = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DieMonth = table.Column<int>(type: "int", nullable: true),
                    DieDay = table.Column<int>(type: "int", nullable: true),
                    DieHouse = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DieField = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepBirthday = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepDices", x => x.SheepDieId);
                });

            migrationBuilder.CreateTable(
                name: "SheepFarms",
                columns: table => new
                {
                    FarmId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FarmNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FarmFullName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FarmShortName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FarmSize = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: true),
                    FarmDetailedAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FarmCreateTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PersId = table.Column<int>(type: "int", nullable: true),
                    DepartmentId = table.Column<int>(type: "int", nullable: true),
                    FormState = table.Column<bool>(type: "bit", nullable: true),
                    FlatId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepFarms", x => x.FarmId);
                });

            migrationBuilder.CreateTable(
                name: "SheepFiles",
                columns: table => new
                {
                    SheepId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Visual = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Electronic = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Breed = table.Column<int>(type: "int", nullable: true),
                    Sex = table.Column<int>(type: "int", nullable: true),
                    Dateofbirth = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Ageindays = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Ageofthemoon = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Presence = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Phase = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sheeptype = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    Field = table.Column<int>(type: "int", nullable: true),
                    Reproductive = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Pregnancy = table.Column<bool>(type: "bit", nullable: true),
                    Statusday = table.Column<int>(type: "int", nullable: true),
                    Production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sales = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Gene = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Birthweight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Weaning = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Weaningdate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Weaningage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Fatherhorn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Femalehorn = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FlatId = table.Column<int>(type: "int", nullable: true),
                    FarmId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepFiles", x => x.SheepId);
                });

            migrationBuilder.CreateTable(
                name: "SheepTransfer",
                columns: table => new
                {
                    SheepTransferId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    EarBugles = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IntoColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Sex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RollOutBuildings = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RollOutColumns = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepTransfer", x => x.SheepTransferId);
                });

            migrationBuilder.CreateTable(
                name: "SheepWeigheds",
                columns: table => new
                {
                    SheepWeigh = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    WeighDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SheepNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Variety = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SheepSex = table.Column<bool>(type: "bit", nullable: true),
                    WeightType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Weight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    WeightMonth = table.Column<int>(type: "int", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SheepWeigheds", x => x.SheepWeigh);
                });

            migrationBuilder.CreateTable(
                name: "Startofseasons",
                columns: table => new
                {
                    SeasonId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Document = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Openingdate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Auricle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CottageId = table.Column<int>(type: "int", nullable: true),
                    Field = table.Column<int>(type: "int", nullable: true),
                    Weight = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Elements = table.Column<int>(type: "int", nullable: true),
                    SheepId = table.Column<int>(type: "int", nullable: true),
                    SeasonType = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Startofseasons", x => x.SeasonId);
                });

            migrationBuilder.CreateTable(
                name: "Users",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserPwd = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserNikeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserSex = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserRealName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserCardType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserPhoto = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Users", x => x.UserId);
                });

            migrationBuilder.CreateTable(
                name: "Vendorcontacts",
                columns: table => new
                {
                    VendorcontactId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    VendorcontactName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorcontactWork = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ProvinceId = table.Column<int>(type: "int", nullable: true),
                    ContactAdress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorcontactPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorcontactEamil = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ContactEamil = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsXuan = table.Column<int>(type: "int", nullable: true),
                    VendorId = table.Column<int>(type: "int", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Vendorcontacts", x => x.VendorcontactId);
                });

            migrationBuilder.CreateTable(
                name: "Vendors",
                columns: table => new
                {
                    VendorId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    VendorTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VfzName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorCard = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorAddr = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vindustry = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VCreditcode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vmnemonic = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vattributes = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VAffiliation = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vstatus = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vunit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Vremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarketName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesmanName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdatedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdatedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DeletedOwnerId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Vendors", x => x.VendorId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AccountingUnits");

            migrationBuilder.DropTable(
                name: "Bankaccounts");

            migrationBuilder.DropTable(
                name: "BasicInfos");

            migrationBuilder.DropTable(
                name: "BreedingHistorys");

            migrationBuilder.DropTable(
                name: "Breedingmothers");

            migrationBuilder.DropTable(
                name: "Breedingsettings");

            migrationBuilder.DropTable(
                name: "ChildbirthTips");

            migrationBuilder.DropTable(
                name: "Clients");

            migrationBuilder.DropTable(
                name: "Cottages");

            migrationBuilder.DropTable(
                name: "CottageTypes");

            migrationBuilder.DropTable(
                name: "Countys");

            migrationBuilder.DropTable(
                name: "Crossbreedings");

            migrationBuilder.DropTable(
                name: "Departments");

            migrationBuilder.DropTable(
                name: "DepartmentTypes");

            migrationBuilder.DropTable(
                name: "Directlys");

            migrationBuilder.DropTable(
                name: "EwesGiveBirths");

            migrationBuilder.DropTable(
                name: "Fields");

            migrationBuilder.DropTable(
                name: "FirstLevels");

            migrationBuilder.DropTable(
                name: "FirstPregnancyTestPrompts");

            migrationBuilder.DropTable(
                name: "Flats");

            migrationBuilder.DropTable(
                name: "FunctionalSystems");

            migrationBuilder.DropTable(
                name: "GPprices");

            migrationBuilder.DropTable(
                name: "LambWeanings");

            migrationBuilder.DropTable(
                name: "MeasurementBodies");

            migrationBuilder.DropTable(
                name: "Permissions");

            migrationBuilder.DropTable(
                name: "Personnels");

            migrationBuilder.DropTable(
                name: "PhaseDeterminations");

            migrationBuilder.DropTable(
                name: "PregnancyTests");

            migrationBuilder.DropTable(
                name: "Provinces");

            migrationBuilder.DropTable(
                name: "Records");

            migrationBuilder.DropTable(
                name: "RolePerms");

            migrationBuilder.DropTable(
                name: "Roles");

            migrationBuilder.DropTable(
                name: "SecondLevels");

            migrationBuilder.DropTable(
                name: "Seedweanings");

            migrationBuilder.DropTable(
                name: "SheepCullings");

            migrationBuilder.DropTable(
                name: "SheepDices");

            migrationBuilder.DropTable(
                name: "SheepFarms");

            migrationBuilder.DropTable(
                name: "SheepFiles");

            migrationBuilder.DropTable(
                name: "SheepTransfer");

            migrationBuilder.DropTable(
                name: "SheepWeigheds");

            migrationBuilder.DropTable(
                name: "Startofseasons");

            migrationBuilder.DropTable(
                name: "Users");

            migrationBuilder.DropTable(
                name: "Vendorcontacts");

            migrationBuilder.DropTable(
                name: "Vendors");
        }
    }
}
